<template>
  <div class="subject">
    <span>{{ x }}</span>
    <span>+</span>
    <span>{{ y }}</span>
    <span>=</span>
    <input type="number" v-model.number="sum" />
    <button @click="btn(index)" onclick="javascript:{this.disabled=true;}">
      提交
    </button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sum: "",
    };
  },
  props: ["x", "y", "index"],
  methods: {
    btn() {
      this.$emit("qiuhe", this.index, this.sum);
    },
  },
};
</script>

<style scoped>
.subject {
  margin: 5px;
  padding: 5px;
  font-size: 20px;
}
.subject span {
  display: inline-block;
  text-align: center;
  width: 20px;
}
.subject input {
  width: 70px;
  height: 20px;
}
</style>